<?php
    if ($_GET['pg'] == 'categories'){
        $query = mysql_query("select * from dt_categories where c_id = '".$_GET['id']."'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['c_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['c_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['c_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'offers'){
        $query = mysql_query("select * from dt_offers where o_id = '".$_GET['pid']."'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['o_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['o_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['o_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'news'){
        $query = mysql_query("select * from dt_news where news_id = '".$_GET['id']."'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'pages'){
        $query = mysql_query("select * from dt_pages where p_id = '".$_GET['id']."'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['p_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['p_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['p_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'top'){
        $query = mysql_query("select * from dt_top_main where id = '".$_GET['id']."'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == ''){
        $query = mysql_query("select * from dt_pages where p_id = '1'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['p_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['p_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['p_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'contact'){
        $query = mysql_query("select * from dt_pages where p_id = '2'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['p_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['p_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['p_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'search'){
        $query = mysql_query("select * from dt_pages where p_id = '8'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['p_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['p_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['p_meta_description'].'" />';
        }
    }
    elseif ($_GET['pg'] == 'sitemap'){
        $query = mysql_query("select * from dt_pages where p_id = '9'");
        while ($row = mysql_fetch_array($query)){
            echo '<title>'.$row['p_meta_title'].'</title>';
            echo '<meta name="keywords" content="'.$row['p_meta_keys'].'" />';
            echo '<meta name="description" content="'.$row['p_meta_description'].'" />';
        }
    }
?>
